﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RedDragon.Common.Domain.Enterprise
{
    /// <summary>
    /// 部门表
    /// </summary>
    public class Departments
    {
        /// <summary>
        /// 部门ID(序号)
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]//IsPrimaryKey 主键 IsIdentity 自增
        public int DepartmentId { get; set; }

        /// <summary>
        /// 状态 1-有效 2-无效
        /// </summary>
        public int DepartmentStatus { get; set; }

        /// <summary>
        /// 节点编码
        /// </summary>
        [SugarColumn(ColumnDataType = "NVarchar(50)", IsNullable = true)]//设置长度 IsNullable可空
        public string NodeEncoding { get; set; }

        /// <summary>
        /// 节点名称
        /// </summary>
        [SugarColumn(ColumnDataType = "NVarchar(100)", IsNullable = true)]//设置长度 IsNullable可空
        public string DepartmentName { get; set; }

        /// <summary>
        /// 父级ID
        /// </summary>
        public int ParentId { get; set; }

        /// <summary>
        /// 是否删除 1-未删除 2-已删除
        /// </summary>
        public int IsDeleted { get; set; }

        /// <summary>
        /// 企业编号(外键)
        /// </summary>
        public int EnterpriseId { get; set; }

        /// <summary>
        /// 子级
        /// </summary>

        [SugarColumn(IsIgnore = true)]
        public List<Departments> Children { get; set; }
    }
}
